<template>
  <main-layout>
      <div class="box">
        <div class="header">
            <div class="userInfo">
            <div></div>
            <h3>OMINI.BASS</h3>
            <p>188****7024</p>
            </div>
            <ul>
            <li>收藏夹<span>190</span></li>
            <li>关注店铺<span>37</span></li>
            <li>足迹<span>99</span></li>
            <li>卡券<span>2</span></li>
            </ul>
        </div>

        <div class="main">
          <div class="middleMain">
            <div class="oder">
              <h3>我的订单</h3>
              <ul>
                <li><i class="iconfont">&#xe76f;</i>待付款</li>
                <li><i class="iconfont">&#xe640;</i>待收货</li>
                <li><i class="iconfont">&#xe63f;</i>已完成</li>
                <li><i class="iconfont">&#xe601;</i>退款/售后</li>
              </ul>
            </div>
            <div class="tool">
              <h3>常用工具</h3>
                <ul>
                  <li><i class="iconfont">&#xe64e;</i>收货地址</li>
                  <li><i class="iconfont">&#xe62a;</i>我的评价</li>
                  <li><i class="iconfont">&#xe60d;</i>签到中心</li>
                  <li><i class="iconfont">&#xe8e7;</i>领券中心</li>
                  <li><i class="iconfont">&#xec2e;</i>客服</li>
                  <li><i class="iconfont">&#xe7d5;</i>店铺直播</li>
                  <li><i class="iconfont">&#xe600;</i>设置</li>
                </ul>
            </div>
           </div>
          <div class="bottomMain">
            <div class="recommend">
              <h3>为你推荐</h3>
            </div>
            <div class="remdProduct">
              <div class="prod" v-for="it in prodList" :key="it.id">
                <img :src="it.image">
                <h5>{{it.title}}</h5>
                <span>满300减30</span>
                <span>店铺领券</span>
                <p>¥ {{it.price}}</p>
              </div>
              <!-- <div class="prod">
                <img src="../../images/me/clothes.webp">
                <h5>OMINI简约及黑色上衣T恤</h5>
                <span>满300减30</span>
                <span>店铺领券</span>
                <p>¥ 523.6</p>
              </div> -->
            </div>
          </div>
        </div>
      </div>
  </main-layout>
</template>
<script>
export default {
  data () {
    return {
      prodList: []
    }
  },
  created () {
    const xhr = new window.XMLHttpRequest()
    xhr.open('GET', 'http://rap2api.taobao.org/app/mock/298670/api/baokuan')
    xhr.send()
    xhr.onreadystatechange = () => {
      if (xhr.readyState === 4) {
        if (xhr.status === 200) {
          // eslint-disable-next-line prefer-const
          let result = xhr.responseText
          // console.log(result)
          this.prodList = JSON.parse(result).data.list
          console.log(this.prodList)
        }
      }
    }
  }
}
</script>
<style lang='less' scoped>
@import '../../style/common.less';
*{
  margin: 0;
  padding: 0;
}
.box{
    background-color: #c1ab96;
}
  .header{
    // background-color: #c1ab96;
    overflow: hidden;
    color: #fff;
    .userInfo{
        margin-top: 50px;
        margin-left: 30px;
      div{
        height: 60px;
        width: 60px;
        background-color: aqua;
        float: left;
        margin-right: 20px;
        border-radius: 50%;
        background-image: url(../../images/me/person.jpg);
        background-size: contain;
      }
      h3{
        font-size: 24px;
        line-height: 24px;
      }
      p{
        font-size: 12px;
      }
    }
    ul{
      display: flex;
      justify-content: space-between;
      margin: 30px 30px;
      font-size: 13px;
      li{
        display: flex;
        flex-direction: column;
        align-items: center;
      }
    }
  }
  .main{
    background-color: #fff;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    overflow: hidden;
    .middleMain{
      color: #333333;
      margin-top: 20px;
        h3{
          font-size: 16px;
          margin-left: 20px;
        }
        ul{
          display: flex;
          font-size: 13px;
          flex-wrap: wrap;
          li{
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 25%;
            margin-bottom: 22px;
            i{
              font-size: 30px;
              color: #a17369;
            }
          }
        }
    }
  }
   .recommend{
        position: relative;
        width: 100%;
        height: 50px;
      h3{
        font-size: 16px;
        position: absolute;
        left: 50%;
        transform: translate(-50%);
      }
    }
    .remdProduct{
      margin: 0 20px;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      .prod{
        box-shadow: 0px 0px 20px #c1bfbf;
        width: 165px;

        img{
          height: 165px;
          width: 165px;
        }
        h5{
          font-size: 14px;
          margin-left: 8px;
        }
        span{
          font-size: 12px;
          border: 1px solid #8E7E6F;
          color: #8E7E6F;
          padding: 2px;
          border-radius: 3px;
          margin-left: 8px;
        }
        p{
          font-size: 14px;
          font-weight: 700;
          margin-left: 8px;
          margin-top: 5px;
        }
      }
    }
</style>
<style lang='less'>
//   @font-face {
//   font-family: 'iconfont';  /* project id 3205211 */
//   src: url('');
//   src: url('?#iefix') format('embedded-opentype'),
//   url('//at.alicdn.com/t/font_3205211_c9vlecgpxwq.woff2') format('woff2'),
//   url('//at.alicdn.com/t/font_3205211_c9vlecgpxwq.woff') format('woff'),
//   url('//at.alicdn.com/t/font_3205211_c9vlecgpxwq.ttf') format('truetype'),
//   url('#iconfont') format('svg');
// }
@font-face {
  font-family: 'iconfont';  /* Project id 3205211 */
  src: url('//at.alicdn.com/t/font_3205211_4cg462uyv1e.woff2?t=1645948895415') format('woff2'),
       url('//at.alicdn.com/t/font_3205211_4cg462uyv1e.woff?t=1645948895415') format('woff'),
       url('//at.alicdn.com/t/font_3205211_4cg462uyv1e.ttf?t=1645948895415') format('truetype');
}
   .iconfont{
    font-family:"iconfont" !important;
    font-size:16px;font-style:normal;
    -webkit-font-smoothing: antialiased;
    -webkit-text-stroke-width: 0.2px;
    -moz-osx-font-smoothing: grayscale;
}
</style>
